﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using University.Workshop.Model;
using University.Workshop.DataAccess;

namespace University.Workshop.Business
{
    public static class ViewOwnProducts
    {
        public static DataTable RegisterOwnProducts(string userName)
        {
            User user;
            DataTable dataTable = null;
            try
            {
                user = UserDataAccess.GetUserByEmail(userName);
                dataTable = ProductDataAccess.GetProductsByUser(user);
            }
            catch (Exception ex)
            {
                throw new BusinessException("Error Show Products", ex);
                
            }
            return dataTable;
        }
    }
}
